Version

CollectionChangeUndoUnit<T> Constructor(ICollection<T>,NotifyCollectionChangedAction,T,Int32,String)

Initializes a new CollectionChangeUndoUnit<T> for an add or remove of a specific item.
Syntax
'Declaration
 
Public Function New( _
   ByVal collection As ICollection(Of T), _
   ByVal action As NotifyCollectionChangedAction, _
   ByVal changedItem As T, _
   ByVal index As Integer, _
   ByVal itemTypeDisplayName As String _
)
public CollectionChangeUndoUnit<T>( 
   ICollection<T> collection,
   NotifyCollectionChangedAction action,
   T changedItem,
   int index,
   string itemTypeDisplayName
)

Parameters

collection
The collection that was modified
action
Must be either 'Add' or 'Remove' to indicate if the item was added or removed.
changedItem
The item that was added or removed.
index
The index at which the item was inserted for an Add or the old index of the item for a Remove action.
itemTypeDisplayName
A string representing the type of items in the collection as they should be presented to the end user or null to use the type name and/or item.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThe collection must not be null.
System.ArgumentExceptionThe collection cannot be ReadOnly.
System.ArgumentExceptionThe action must be 'Add' or 'Remove'.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also